#!/usr/bin/env python
#    dft_properties_sym
#    ------------------
#    Molecule:         H2O
#    Wave Functions:   DFT B3LYP / cc-pVDZ
#    Test Purpose:     DFT B3LYP properties test w/symmetry:
#                      Shieldings, excitation energies, spin-spin, darwin,
#                      mass-vel., dipol, spin-orbit,  P-viola

import os
import sys

sys.path.append(os.path.join(os.path.dirname(__file__), '..'))
from runtest_dalton import Filter, TestRun

test = TestRun(__file__, sys.argv)

f = Filter()
f.add(string = 'Final DFT energy',
      rel_tolerance = 1.0e-8)

# Relativistic corrections
f.add(from_string = 'Breit-Pauli relativistic corrections',
      num_lines = 5,
      rel_tolerance = 1.0e-8)

# Dipole moment
f.add(from_string = 'Dipole moment',
      num_lines = 5,
      mask = [1],
      rel_tolerance = 1.0e-5)

# Excitation energies
f.add(from_string = 'Singlet electronic excitation energies',
      num_lines = 10,
      mask = [4],
      rel_tolerance = 1.0e-5)

# H and O shieldings
f.add(from_string = 'Chemical shielding for ',
      num_lines = 10,
      abs_tolerance = 1.0e-3)
f.add(from_string = 'Total shielding tensor (ppm):',
      num_lines = 10,
      abs_tolerance = 1.0e-4)

# H-H spin-spin coupling
f.add(from_re = 'Indirect spin-spin coupling between ',
      num_lines = 17,
      abs_tolerance = 1.0e-3)

test.run(['dft_properties_sym.dal'], ['H2O_cc-pVDZ.mol'], f={'out': f})

sys.exit(test.return_code)
